﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BLL;
using DAL;

public partial class MasterPage_Hoso : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) { 
            if(Session["tenthanhvien"] == null) Response.Redirect("../LogIn.aspx");

            THANHVIEN tv = (THANHVIEN)Session["thanhvienObject"];
            Label_tenttvietbai.Text = tv.tenthanhvien;
            Label_chucvuttvietbai.Text = tv.chucvu;
            if (!string.IsNullOrEmpty(tv.hinh))
            {
                Image_thanhvienvietbai.ImageUrl = "~/Hoso/hinh/Avatar/" + tv.mathanhvien.ToString() + "/" + tv.hinh;
            }
            else
            {
                Image_thanhvienvietbai.ImageUrl = "~/Hoso/hinh/Avatar/no_avatar.png";
            }
        }
    }
    protected void LinkButton4_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("../LogIn.aspx");
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        Response.Redirect("../Home.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("#");
    }
    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        Response.Redirect("../Timkiem.aspx");
    }
}
